
**************************************************************************************
**************************************************************************************
* This do-file contains replication coding for the following article:
* Girls' education and cancer awareness and screening in Lesotho
* Authors: Liao, Moshoeshoe, Holmes, Subramanian, De Neve (2025)
* Stata version 17.0 was used for all analyses.
* Date: 17 February 2025
**************************************************************************************
**************************************************************************************

version 17.0

ssc install blindschemes 
set scheme plotplain
	
*************************************************************************************
* APPENDING LESOTHO 2009-10 AND 2014 DHS IR DATASETS FOR BREAST CANCER
*************************************************************************************

/*
We used unrestricted data which are publicly available upon request from the Demographic and Health Surveys Program (https://dhsprogram.com/). Dataset requests must include contact information, a research project title, and a description of the proposed analysis of the data.
*/

**# Bookmark

* DHS 2009-10 (women)

use "D:\BRST CNR\raw data\DHS\lesotho\2009\LSIR61DT\LSIR61FL.DTA", clear
keep v009 v012 v106 v107 v133 v149 v221 s1012j-s1012m v137 v201 v218 v219 v004 v024 v025 v006 v103 v104 v105 v021 v022 v023 v005 v021 v743a v481 v501 s1012j s1012k s1012l s1012m v701 v729 v715 v155 v190 v445 v213 v010 v438 v156 v155 v157 v158 v159 v212 v221 v218 v201 v190 v001 v002 v003 v158 v159 v028 v190 v007
save "temp.dta", replace

use "D:\BRST CNR\raw data\DHS\lesotho\2009\LSPR61DT\LSPR61FL.DTA" // adding distance from household to health facility using PR datasets
keep hvidx hv000 hv001 hv002 hv003 sh128 sh129m sh129h
rename hv001 v001 // cluster number
rename hv002 v002 // household number
rename hvidx v003 // respondent line number
duplicates report v002 v001 v003 // check if cluster household and line numbers uniquely identify respondents
merge 1:m v001 v002 v003 using "temp.dta" 
keep if _merge == 3
drop _merge

gen breastselfexam = s1012j
gen breastclinical = s1012k
gen everheardpap = s1012l
gen everpapsmear = s1012m

rename sh128 modetransport 
rename sh129h timetocare

gen year = v007
save LSdhswomen2009.dta, replace

* DHS 2014 (women)

use "D:\BRST CNR\raw data\DHS\lesotho\2014\LSIR71DT\LSIR71FL.DTA", clear
keep v009 v012 v106 v107 v133 v149 v221 s1012j-s1012m v137 v201 v218 v219 v004 v024 v025 v006 v103 v104 v105 v021 v022 v023 v005 v021 v743a v481 v501 s1012j s1012n s1012o s1012l s1012m v715 v155 v190 v445 v213 v010 v438 v001 v002 v003 v157 v028 v190 v007
save "temp.dta", replace

use "D:\BRST CNR\raw data\DHS\lesotho\2014\LSPR71DT\LSPR71FL.DTA", clear // adding distance from household to health facility using PR datasets
keep hvidx hv000 hv001 hv002 hv003 sh126h sh126m sh125
rename hv001 v001 // cluster number
rename hv002 v002 // household number
rename hvidx v003 // respondent line number
duplicates report v002 v001 v003 // check if cluster household and line numbers uniquely identify respondents
merge 1:m v001 v002 v003 using "temp.dta" 
keep if _merge == 3
drop _merge

gen everheardbreast = s1012j // variable "s1012j" is a different outcome in the 2014 survey
gen breastselfexam = s1012l // variable "s1012l" is a different outcome in the 2014 survey
gen breastclinical = s1012m // variable "s1012m" is a different outcome in the 2014 survey
gen everheardpap = s1012n
gen everpapsmear = s1012o

rename sh125 modetransport 
rename sh126h timetocare

gen year = v007
save LSdhswomen2014.dta, replace

* Appending both datasets

use LSdhswomen2009.dta
append using LSdhswomen2014.dta

*************************************************************************************
* PREPARING VARIABLES
*************************************************************************************

gen age = v012
gen birthmo = v009
gen birthmo_cent = birthmo - 6.5
gen birthyr = v010
gen eduyrs = v133
gen height = v438/10 if v438 < 2000

gen lit = 1 if v155 == 2 
replace lit = 0 if v155 == 0
replace lit = 0 if v155 == 1

gen edulevel = 0 if v149 == 0 | v149 == 1
replace edulevel = 1 if v149 == 2
replace edulevel = 2 if v149 == 3
replace edulevel = 3 if v149 == 4
replace edulevel = 4 if v149== 5

label define edulevellab 0 "Incomplete primary or less" 1 "Complete primary" 2 "Incomplete secondary" 3 "Complete secondary" 4 "Higher", modify
label values edulevel edulevellab

gen sampleweight = v005
gen birthmo_jul = birthmo >= 7 & birthmo <= 12 // our "instrumental variable"

replace everpapsmear = 0 if everheardpap == 0

gen anypap = 0
replace anypap = 1 if everheardpap == 1 | everpapsmear == 1

generate knowledge = 0
replace knowledge= 1 if everheardbreast == 1 | everheardpap == 1

generate screen = 0 
replace screen = 1 if breastselfexam == 1 | breastclinical == 1 | everpapsmear == 1

generate clinical = 0 
replace clinical = 1 if breastclinical == 1 | everpapsmear == 1

replace modetransport = . if modetransport == 98
replace timetocare = . if timetocare == 97 | timetocare == 98

gen readnews = 0 if v157 == 0
replace readnews = 1 if v157 == 1 | v157 == 2 | v157 == 3

gen interID = v028

gen weight = v005/1000000

gen insured = 1 if v481 == 1 // health insurance
replace insured = 0 if v481 == 0

gen wi = v190 // household wealth index

gen access = 1 if timetocare <= 2
replace access = 0 if timetocare > 2 & timetocare < 100

gen atleast1 = eduyrs >= 1 & eduyrs < . // completed at least X years of schooling
gen atleast2 = eduyrs >= 2 & eduyrs < . 
gen atleast3 = eduyrs >= 3 & eduyrs < . 
gen atleast4 = eduyrs >= 4 & eduyrs < . 
gen atleast5 = eduyrs >= 5 & eduyrs < . 
gen atleast6 = eduyrs >= 6 & eduyrs < . 
gen atleast7 = eduyrs >= 7 & eduyrs < . 
gen atleast8 = eduyrs >= 8 & eduyrs < . 
gen atleast9 = eduyrs >= 9 & eduyrs < . 
gen atleast10 = eduyrs >= 10 & eduyrs < .
gen atleast11 = eduyrs >= 11 & eduyrs < .  
gen atleast12 = eduyrs >= 12 & eduyrs < . 
gen atleast13 = eduyrs >= 13 & eduyrs < . 
gen atleast14 = eduyrs >= 14 & eduyrs < . 
gen atleast15 = eduyrs >= 15 & eduyrs < . 

save LSdhs2009_14_full.dta, replace

*************************************************************************************
* SAMPLE INCLUSION CRITERIA
*************************************************************************************

keep if age < . // complete data on age
keep if birthmo < . // complete data on birthmonth
keep if eduyrs < . // complete date on years of schooling 
keep if age >= 25 // so that women had the opportunity to complete all their schooling
keep if everpapsmear < .
drop if breastclinical == 8
save LSdhs2009_14.dta, replace

*************************************************************************************
* DESCRIPTIVE STATISTICS
*************************************************************************************

**# Bookmark

* Ever heard of breast cancer (unweighted)

tab everheardbreast if year == 2009 | year == 2010
tab everheardbreast if year == 2014
tab everheardbreast if year == 2009 | year == 2010 | year == 2014 // women in 2009 and 2014

* Breast self-exam

tab breastselfexam if year == 2009 | year == 2010
tab breastselfexam if year == 2014
tab breastselfexam if year == 2009 | year == 2010 | year == 2014 // women in 2009 and 2014

* Breast clinical exam

tab breastclinical if year == 2009 | year == 2010 // women in 2009
tab breastclinical if year == 2014 // women in 2014
tab breastclinical if year == 2009 | year == 2010 | year == 2014 // women in 2009 and 2014

* Ever heard of pap smear

tab everheardpap if year == 2009 | year == 2010
tab everheardpap if year == 2014
tab everheardpap if year == 2009 | year == 2010 | year == 2014 // women in 2009 and 2014

* Ever had pap smear

tab everpapsmear if year == 2009 | year == 2010
tab everpapsmear if year == 2014
tab everpapsmear if year == 2009 | year == 2010 | year == 2014 // women in 2009 and 2014

*************************************************************************************
* FIGURES 
*************************************************************************************

* Cancer awareness and screening by educational attainment

use LSdhs2009_14.dta, clear
cibar breastselfexam, over1(edulevel) graphopts(ytitle (Probability performed breast self-exam))
graph save Graph "graph 1.dta", replace
cibar breastclinical, over1(edulevel) graphopts(ytitle (Probability performed breast clinical exam))
graph save Graph "graph 2.dta", replace
cibar everheardpap, over1(edulevel) graphopts(ytitle (Probability heard of pap smear))
graph save Graph "graph 3.dta", replace
cibar everpapsmear, over1(edulevel) graphopts(ytitle (Probability received pap smear))
graph save Graph "graph 4.dta", replace
graph combine "graph 1.dta" "graph 2.dta" "graph 3.dta" "graph 4.dta", col(2) ysize(4) xsize(7) scale(1)
 
* Total years of schooling completed by month of birth

use LSdhs2009_14.dta, clear
collapse (mean) y=eduyrs (semean) se_y=eduyrs, by(birthmo)
drop if birthmo==.
gen yu = y + 1.96*se_y
gen yl = y - 1.96*se_y
twoway (scatter y birthmo, xlabel(1(1)12)  xline(6.6) legend(off) xtitle("Month of birth") ytitle("Total years of schooling completed") xlabel(1 "Jan" 2 "Feb" 3 "Mar" 4 "Apr" 5 "May" 6 "Jun" 7 "Jul" 8 "Aug" 9 "Sep" 10 "Oct" 11 "Nov" 12 "Dec")) (rcap yu yl birthmo)

* Distribution in MOB

use LSdhs2009_14_full.dta, clear
hist birthmo if age >=15 & age <=24, xlabel(1(1)12) xline(6.5) ylabel(0(200)800) xtitle("Month of birth") ytitle("Number of respondents") xlabel(1 "Jan" 2 "Feb" 3 "Mar" 4 "Apr" 5 "May" 6 "Jun" 7 "Jul" 8 "Aug" 9 "Sep" 10 "Oct" 11 "Nov" 12 "Dec",labsize(small)) disc freq

* Placebo using measured height 

use LSdhs2009_14.dta, clear
collapse (mean) y=height (semean) se_y=height if year == 2009 | year == 2010, by(birthmo_jul)
drop if birthmo==.
gen yu = y + 1.96*se_y
gen yl = y - 1.96*se_y
twoway (scatter y birthmo, xlabel(0(1)2) legend(off) title("(a) DHS 2009-10 (+/- 6 months)") xtitle("Month of birth") ytitle("Measured height (cm)") xlabel(0 "Jan-Jun" 1 "Jul-Dec")) (rcap yu yl birthmo)
graph save Graph "D:\BRST CNR\graph 1.dta", replace

use LSdhs2009_14.dta, clear
collapse (mean) y=height (semean) se_y=height if year == 2014 , by(birthmo_jul)
drop if birthmo==.
gen yu = y + 1.96*se_y
gen yl = y - 1.96*se_y
twoway (scatter y birthmo, xlabel(0(1)2) legend(off) title("(b) DHS 2014 (+/- 6 months)") xtitle("Month of birth") ytitle("Measured height (cm)") xlabel(0 "Jan-Jun" 1 "Jul-Dec")) (rcap yu yl birthmo)
graph save Graph "D:\BRST CNR\graph 2.dta", replace

use LSdhs2009_14.dta, clear
keep if birthmo >=4 & birthmo <= 9
collapse (mean) y=height (semean) se_y=height if year == 2009 | year == 2010, by(birthmo_jul)
drop if birthmo==.
gen yu = y + 1.96*se_y
gen yl = y - 1.96*se_y
twoway (scatter y birthmo, xlabel(0(1)2) legend(off) title("(c) DHS 2009-10 (+/- 3 months)") xtitle("Month of birth") ytitle("Measured height (cm)") xlabel(0 "Jan-Jun" 1 "Jul-Dec")) (rcap yu yl birthmo)
graph save Graph "D:\BRST CNR\graph 3.dta", replace

use LSdhs2009_14.dta, clear
keep if birthmo >=4 & birthmo <= 9
collapse (mean) y=height (semean) se_y=height if year == 2014, by(birthmo_jul)
drop if birthmo==.
gen yu = y + 1.96*se_y
gen yl = y - 1.96*se_y
twoway (scatter y birthmo, xlabel(0(1)2) legend(off) title("(d) DHS 2014 (+/- 3 months)") xtitle("Month of birth") ytitle("Measured height (cm)") xlabel(0 "Jan-Jun" 1 "Jul-Dec")) (rcap yu yl birthmo)
graph save Graph "D:\BRST CNR\graph 4.dta", replace

graph combine "D:\BRST CNR\graph 1.dta" "D:\BRST CNR\graph 2.dta" "D:\BRST CNR\graph 3.dta" "D:\BRST CNR\graph 4.dta", col(2)  scale(1)

* Cancer awareness and screening by month of birth

use LSdhs2009_14.dta, clear // women
collapse (mean) y=everheardbreast (semean) se_y=everheardbreast, by(birthmo_jul)
gen yu = y + 1.96*se_y
gen yl = y - 1.96*se_y
twoway (scatter y birthmo_jul, xlabel(0(1)1) xlabel(-1 " " 0 "Jan-Jun" 1 "Jul-Dec" 2 " ", noticks) title("(a) Heard of breast cancer (female)", color(black)) xtitle("Month of birth") ytitle("Pr(ever heard of breast cancer)") legend(off)) (rcap yu yl birthmo_jul) 
graph save Graph "D:\BRST CNR\graph 1.dta", replace

use "D:\BRST CNR\raw data\DHS\lesotho\2014\LSMR71DT\LSMR71FL.DTA", clear // men
gen age = mv012
gen birthmo = mv009
gen birthyr = mv010
gen eduyrs = mv133
gen birthmo_jul = birthmo >= 7 & birthmo <= 12 // our "instrumental variable"
gen everheardbreast = 1 if sm812j == 1
replace everheardbreast = 0 if sm812j == 0
keep if age >= 25
collapse (mean) y=everheardbreast (semean) se_y=everheardbreast, by(birthmo_jul)
gen yu = y + 1.96*se_y
gen yl = y - 1.96*se_y
twoway (scatter y birthmo_jul, xlabel(0(1)1) xlabel(-1 " " 0 "Jan-Jun" 1 "Jul-Dec" 2 " ", noticks) title("(b) Heard of breast cancer (male)", color(black)) xtitle("Month of birth") ytitle("Pr(ever heard of breast cancer)") legend(off)) (rcap yu yl birthmo_jul) 
graph save Graph "D:\BRST CNR\graph 2.dta", replace

use LSdhs2009_14.dta, clear
collapse (mean) y=breastselfexam (semean) se_y=breastselfexam, by(birthmo_jul)
gen yu = y + 1.96*se_y
gen yl = y - 1.96*se_y
twoway (scatter y birthmo_jul, xlabel(0(1)1) xlabel(-1 " " 0 "Jan-Jun" 1 "Jul-Dec" 2 " ", noticks) title("(c) Breast self-exam (female)", color(black)) xtitle("Month of birth") ytitle("(Pr(ever breast self-exam)") legend(off)) (rcap yu yl birthmo_jul) 
graph save Graph "D:\BRST CNR\graph 3.dta", replace

use LSdhs2009_14.dta, clear
collapse (mean) y=breastclinical (semean) se_y=breastclinical, by(birthmo_jul)
gen yu = y + 1.96*se_y
gen yl = y - 1.96*se_y
twoway (scatter y birthmo_jul, xlabel(0(1)1) xlabel(-1 " " 0 "Jan-Jun" 1 "Jul-Dec" 2 " ", noticks) title("(d) Breast clinical exam (female)", color(black)) xtitle("Month of birth") ytitle("(Pr(ever breast self-exam)") legend(off)) (rcap yu yl birthmo_jul) 
graph save Graph "D:\BRST CNR\graph 4.dta", replace

use LSdhs2009_14.dta, clear
collapse (mean) y=everheardpap (semean) se_y=everheardpap, by(birthmo_jul)
gen yu = y + 1.96*se_y
gen yl = y - 1.96*se_y
twoway (scatter y birthmo_jul, xlabel(0(1)1) xlabel(-1 " " 0 "Jan-Jun" 1 "Jul-Dec" 2 " ", noticks) title("(e) Heard of Pap smear (female)", color(black)) xtitle("Month of birth") ytitle("Pr(ever heard of Pap smear)") legend(off)) (rcap yu yl birthmo_jul) 
graph save Graph "D:\BRST CNR\graph 5.dta", replace

use LSdhs2009_14.dta, clear
collapse (mean) y=everpapsmear (semean) se_y=everpapsmear, by(birthmo_jul)
gen yu = y + 1.96*se_y
gen yl = y - 1.96*se_y
twoway (scatter y birthmo_jul, xlabel(0(1)1) xlabel(-1 " " 0 "Jan-Jun" 1 "Jul-Dec" 2 " ", noticks) title("(f) Ever had Pap smear (female)", color(black)) xtitle("Month of birth") ytitle("Pr(ever had Pap smear)") legend(off)) (rcap yu yl birthmo_jul) 
graph save Graph "D:\BRST CNR\graph 6.dta", replace

graph combine "D:\BRST CNR\graph 1.dta" "D:\BRST CNR\graph 2.dta" "D:\BRST CNR\graph 3.dta" "D:\BRST CNR\graph 4.dta" "D:\BRST CNR\graph 5.dta" "D:\BRST CNR\graph 6.dta", col(2) ysize(4) xsize(4) scale(1)

* Causal pathways 

use LSdhs2009_14.dta, clear
collapse (mean) y=lit (semean) se_y=lit, by(birthmo_jul)
gen yu = y + 1.96*se_y
gen yl = y - 1.96*se_y
twoway (scatter y birthmo_jul, xlabel(0(1)1) xlabel(-1 " " 0 "Jan-Jun" 1 "Jul-Dec" 2 " ", noticks) title("(a) Measured literacy", color(black)) xtitle("Month of birth") ytitle("Pr(literate)") legend(off)) (rcap yu yl birthmo_jul) 
graph save Graph "D:\BRST CNR\graph 1.dta", replace

use LSdhs2009_14.dta, clear
collapse (mean) y=wi (semean) se_y=wi, by(birthmo_jul)
gen yu = y + 1.96*se_y
gen yl = y - 1.96*se_y
twoway (scatter y birthmo_jul, xlabel(0(1)1) xlabel(-1 " " 0 "Jan-Jun" 1 "Jul-Dec" 2 " ", noticks) title("(b) Household wealth", color(black)) xtitle("Month of birth") ytitle("Household wealth quintile") legend(off)) (rcap yu yl birthmo_jul) 
graph save Graph "D:\BRST CNR\graph 2.dta", replace

use LSdhs2009_14.dta, clear
collapse (mean) y=insured (semean) se_y=insured, by(birthmo_jul)
gen yu = y + 1.96*se_y
gen yl = y - 1.96*se_y
twoway (scatter y birthmo_jul, xlabel(0(1)1) xlabel(-1 " " 0 "Jan-Jun" 1 "Jul-Dec" 2 " ", noticks) title("(c) Health insurance", color(black)) xtitle("Month of birth") ytitle("Pr(health insurance coverage)") legend(off)) (rcap yu yl birthmo_jul) 
graph save Graph "D:\BRST CNR\graph 3.dta", replace

use LSdhs2009_14.dta, clear
collapse (mean) y=access (semean) se_y=access, by(birthmo_jul)
gen yu = y + 1.96*se_y
gen yl = y - 1.96*se_y
twoway (scatter y birthmo_jul, xlabel(0(1)1) xlabel(-1 " " 0 "Jan-Jun" 1 "Jul-Dec" 2 " ", noticks) title("(d) Distance to health facility", color(black)) xtitle("Month of birth") ytitle("Pr(2 hours or less to nearest facility)") legend(off)) (rcap yu yl birthmo_jul) 
graph save Graph "D:\BRST CNR\graph 4.dta", replace

graph combine "D:\BRST CNR\graph 1.dta" "D:\BRST CNR\graph 2.dta" "D:\BRST CNR\graph 3.dta" "D:\BRST CNR\graph 4.dta", col(2) ysize(4) xsize(4) scale(1)

*************************************************************************************
* REGRESSION RESULTS
*************************************************************************************

* "naive" OLS results

use LSdhs2009_14.dta, clear
reg everheardbreast eduyrs i.birthyr i.year, r
est sto m1
margins if birthmo_jul == 0
reg breastselfexam eduyrs i.birthyr i.year, r
est sto m2
margins if birthmo_jul == 0
reg breastclinical eduyrs i.birthyr i.year, r
est sto m3
margins if birthmo_jul == 0
reg everheardpap eduyrs i.birthyr i.year, r
est sto m4
margins if birthmo_jul == 0
reg everpapsmear eduyrs i.birthyr i.year, r
est sto m5
margins if birthmo_jul == 0
outreg2 [m1 m2 m3 m4 m5] using results.xlsx, keep (eduyrs) dec(3) replace

* First stage results

use LSdhs2009_14.dta, clear
reg eduyrs birthmo_jul, r
est sto m1
margins if birthmo_jul == 0
reg eduyrs birthmo_jul i.year, r
est sto m2
margins if birthmo_jul == 0
reg eduyrs birthmo_jul i.birthyr i.year, r
est sto m3
margins if birthmo_jul == 0
reg eduyrs birthmo_jul c.birthmo i.birthyr i.year, r
est sto m4
margins if birthmo_jul == 0
reg eduyrs birthmo_jul c.birthmo i.age i.birthyr i.year, r
est sto m5
margins if birthmo_jul == 0
outreg2 [m1 m2 m3 m4 m5] using results.xlsx, keep (birthmo_jul) dec(3) replace

* Intention-to-treat results

use LSdhs2009_14.dta, clear
reg everheardbreast birthmo_jul i.birthyr i.year, r
est sto m1
margins if birthmo_jul == 0
reg breastselfexam birthmo_jul i.birthyr i.year, r
est sto m2
margins if birthmo_jul == 0
reg breastclinical birthmo_jul i.birthyr i.year, r
est sto m3
margins if birthmo_jul == 0
reg everheardpap birthmo_jul i.birthyr i.year, r
est sto m4
margins if birthmo_jul == 0
reg everpapsmear birthmo_jul i.birthyr i.year, r
est sto m5
margins if birthmo_jul == 0
outreg2 [m1 m2 m3 m4 m5] using results.xlsx, keep (birthmo_jul) dec(3) replace

* Instrumental variable regressions

use LSdhs2009_14.dta, clear
ivregress 2sls everheardbreast i.birthyr i.year (eduyrs = birthmo_jul), r
est sto m1
estat firststage
margins if birthmo_jul == 0
ivregress 2sls breastselfexam i.birthyr i.year (eduyrs = birthmo_jul), r
est sto m2
estat firststage
margins if birthmo_jul == 0
ivregress 2sls breastclinical i.birthyr i.year (eduyrs = birthmo_jul), r
est sto m3
estat firststage
margins if birthmo_jul == 0
ivregress 2sls everheardpap i.birthyr i.year (eduyrs = birthmo_jul), r
est sto m4
estat firststage
margins if birthmo_jul == 0
ivregress 2sls everpapsmear i.birthyr i.year (eduyrs = birthmo_jul), r
est sto m5
estat firststage
margins if birthmo_jul == 0
outreg2 [m1 m2 m3 m4 m5] using results.xlsx, keep (eduyrs) dec(3) replace

*************************************************************************************
* COMPLETED AT LEAST X YEARS OF SCHOOLING	
*************************************************************************************

**# Bookmark

use LSdhs2009_14.dta, clear
reg atleast1 birthmo_jul i.birthyr i.year, r
est sto m1
margins if birthmo_jul == 0
reg atleast2 birthmo_jul i.birthyr i.year, r
est sto m2
margins if birthmo_jul == 0
reg atleast3 birthmo_jul i.birthyr i.year, r
est sto m3
margins if birthmo_jul == 0
reg atleast4 birthmo_jul i.birthyr i.year, r
est sto m4
margins if birthmo_jul == 0
reg atleast5 birthmo_jul i.birthyr i.year, r
est sto m5
margins if birthmo_jul == 0
reg atleast6 birthmo_jul i.birthyr i.year, r
est sto m6
margins if birthmo_jul == 0
reg atleast7 birthmo_jul i.birthyr i.year, r
est sto m7
margins if birthmo_jul == 0
reg atleast8 birthmo_jul i.birthyr i.year, r
est sto m8
margins if birthmo_jul == 0
reg atleast9 birthmo_jul i.birthyr i.year, r
est sto m9
margins if birthmo_jul == 0
reg atleast10 birthmo_jul i.birthyr i.year, r
est sto m10
margins if birthmo_jul == 0
reg atleast11 birthmo_jul i.birthyr i.year, r
est sto m11
margins if birthmo_jul == 0
reg atleast12 birthmo_jul i.birthyr i.year, r
est sto m12
margins if birthmo_jul == 0
outreg2 [m1 m2 m3 m4 m5 m6 m7 m8 m9 m10 m11 m12] using results.xlsx, keep (birthmo_jul) dec(3) replace

*************************************************************************************
* SENSITIVITY ANALYSES
*************************************************************************************

* Breast cancer awareness

use LSdhs2009_14_full.dta, clear
keep if age < . // complete data on age
keep if birthmo < . // complete data on birthmonth
keep if eduyrs < . // complete date on years of schooling 
keep if everpapsmear < .
drop if breastclinical == 8
ivregress 2sls everheardbreast i.birthyr i.year (eduyrs = birthmo_jul) if age >= 15, r
est sto m1
estat firststage
margins if birthmo_jul == 0
ivregress 2sls everheardbreast i.birthyr i.year (eduyrs = birthmo_jul) if age >= 35, r
est sto m2
estat firststage
margins if birthmo_jul == 0
ivregress 2sls everheardbreast i.birthyr i.year (eduyrs = birthmo_jul) if age >= 25 & year == 2014, r
est sto m3
estat firststage
margins if birthmo_jul == 0
ivregress 2sls everheardbreast i.birthyr i.year (eduyrs = birthmo_jul) if age >= 25 & (birthmo >= 4 & birthmo <= 9), r
est sto m5
estat firststage
margins if birthmo_jul == 0
ivregress 2sls everheardbreast i.birthyr i.year i.interID (eduyrs = birthmo_jul) if age >= 25, r
est sto m6
estat firststage
margins if birthmo_jul == 0
outreg2 [m1 m2 m3 m5 m6] using results.xlsx, keep (eduyrs) dec(3) replace

* Breast self-exam

use LSdhs2009_14_full.dta, clear
keep if age < . // complete data on age
keep if birthmo < . // complete data on birthmonth
keep if eduyrs < . // complete date on years of schooling 
keep if everpapsmear < .
drop if breastclinical == 8
ivregress 2sls breastselfexam i.birthyr i.year (eduyrs = birthmo_jul) if age >= 15, r
est sto m1
estat firststage
margins if birthmo_jul == 0
ivregress 2sls breastselfexam i.birthyr i.year (eduyrs = birthmo_jul) if age >= 35, r
est sto m2
estat firststage
margins if birthmo_jul == 0
ivregress 2sls breastselfexam i.birthyr i.year (eduyrs = birthmo_jul) if age >= 25 & year == 2014, r
est sto m3
estat firststage
margins if birthmo_jul == 0
ivregress 2sls breastselfexam i.birthyr i.year (eduyrs = birthmo_jul) if age >= 25 & (year == 2009 | year == 2010), r
est sto m4
estat firststage
margins if birthmo_jul == 0
ivregress 2sls breastselfexam i.birthyr i.year (eduyrs = birthmo_jul) if age >= 25 & (birthmo >= 4 & birthmo <= 9), r
est sto m5
estat firststage
margins if birthmo_jul == 0
ivregress 2sls breastselfexam i.birthyr i.year i.interID (eduyrs = birthmo_jul) if age >= 25, r
est sto m6
estat firststage
margins if birthmo_jul == 0
outreg2 [m1 m2 m3 m4 m5 m6] using results.xlsx, keep (eduyrs) dec(3) replace

* Breast clinical exam

use LSdhs2009_14_full.dta, clear
keep if age < . // complete data on age
keep if birthmo < . // complete data on birthmonth
keep if eduyrs < . // complete date on years of schooling 
keep if everpapsmear < .
drop if breastclinical == 8
ivregress 2sls breastclinical i.birthyr i.year (eduyrs = birthmo_jul) if age >= 15, r
est sto m1
estat firststage
margins if birthmo_jul == 0
ivregress 2sls breastclinical i.birthyr i.year (eduyrs = birthmo_jul) if age >= 35, r
est sto m2
estat firststage
margins if birthmo_jul == 0
ivregress 2sls breastclinical i.birthyr i.year (eduyrs = birthmo_jul) if age >= 25 & year == 2014, r
est sto m3
estat firststage
margins if birthmo_jul == 0
ivregress 2sls breastclinical i.birthyr i.year (eduyrs = birthmo_jul) if age >= 25 & (year == 2009 | year == 2010), r
est sto m4
estat firststage
margins if birthmo_jul == 0
ivregress 2sls breastclinical i.birthyr i.year (eduyrs = birthmo_jul) if age >= 25 & (birthmo >= 4 & birthmo <= 9), r
est sto m5
estat firststage
margins if birthmo_jul == 0
ivregress 2sls breastclinical i.birthyr i.year i.interID (eduyrs = birthmo_jul) if age >= 25, r
est sto m6
estat firststage
margins if birthmo_jul == 0
outreg2 [m1 m2 m3 m4 m5 m6] using results.xlsx, keep (eduyrs) dec(3) replace

* Ever heard of pap smear

use LSdhs2009_14_full.dta, clear
keep if age < . // complete data on age
keep if birthmo < . // complete data on birthmonth
keep if eduyrs < . // complete date on years of schooling 
keep if everpapsmear < .
drop if breastclinical == 8
ivregress 2sls everheardpap i.birthyr i.year (eduyrs = birthmo_jul) if age >= 15, r
est sto m1
estat firststage
margins if birthmo_jul == 0
ivregress 2sls everheardpap i.birthyr i.year (eduyrs = birthmo_jul) if age >= 35, r
est sto m2
estat firststage
margins if birthmo_jul == 0
ivregress 2sls everheardpap i.birthyr i.year (eduyrs = birthmo_jul) if age >= 25 & year == 2014, r
est sto m3
estat firststage
margins if birthmo_jul == 0
ivregress 2sls everheardpap i.birthyr i.year (eduyrs = birthmo_jul) if age >= 25 & (year == 2009 | year == 2010), r
est sto m4
estat firststage
margins if birthmo_jul == 0
ivregress 2sls everheardpap i.birthyr i.year (eduyrs = birthmo_jul) if age >= 25 & (birthmo >= 4 & birthmo <= 9), r
est sto m5
estat firststage
margins if birthmo_jul == 0
ivregress 2sls everheardpap i.birthyr i.year i.interID (eduyrs = birthmo_jul) if age >= 25, r
est sto m6
estat firststage
margins if birthmo_jul == 0
outreg2 [m1 m2 m3 m4 m5 m6] using results.xlsx, keep (eduyrs) dec(3) replace

* Ever had pap smear

use LSdhs2009_14_full.dta, clear
keep if age < . // complete data on age
keep if birthmo < . // complete data on birthmonth
keep if eduyrs < . // complete date on years of schooling 
keep if everpapsmear < .
drop if breastclinical == 8
ivregress 2sls everpapsmear i.birthyr i.year (eduyrs = birthmo_jul) if age >= 15, r
est sto m1
estat firststage
margins if birthmo_jul == 0
ivregress 2sls everpapsmear i.birthyr i.year (eduyrs = birthmo_jul) if age >= 35, r
est sto m2
estat firststage
margins if birthmo_jul == 0
ivregress 2sls everpapsmear i.birthyr i.year (eduyrs = birthmo_jul) if age >= 25 & year == 2014, r
est sto m3
estat firststage
margins if birthmo_jul == 0
ivregress 2sls everpapsmear i.birthyr i.year (eduyrs = birthmo_jul) if age >= 25 & (year == 2009 | year == 2010), r
est sto m4
estat firststage
margins if birthmo_jul == 0
ivregress 2sls everpapsmear i.birthyr i.year (eduyrs = birthmo_jul) if age >= 25 & (birthmo >= 4 & birthmo <= 9), r
est sto m5
estat firststage
margins if birthmo_jul == 0
ivregress 2sls everpapsmear i.birthyr i.year i.interID (eduyrs = birthmo_jul) if age >= 25, r
est sto m6
estat firststage
margins if birthmo_jul == 0
outreg2 [m1 m2 m3 m4 m5 m6] using results.xlsx, keep (eduyrs) dec(3) replace

*************************************************************************************
* RELATIVE RISK
*************************************************************************************

**# Bookmark

use LSdhs2009_14.dta, clear
ivpoisson cfunction everheardbreast birthyr year (eduyrs = birthmo_jul), irr 
margins if birthmo_jul == 0
est sto m1
ivpoisson cfunction breastselfexam birthyr year (eduyrs = birthmo_jul), irr 
margins if birthmo_jul == 0
est sto m2
ivpoisson cfunction breastclinical birthyr year (eduyrs = birthmo_jul), irr 
margins if birthmo_jul == 0
est sto m3
ivpoisson cfunction everheardpap birthyr year (eduyrs = birthmo_jul), irr 
est sto m4
margins if birthmo_jul == 0
ivpoisson cfunction everpapsmear birthyr year (eduyrs = birthmo_jul), irr 
margins if birthmo_jul == 0
est sto m5
outreg2 [m1 m2 m3 m4 m5] using results.xlsx, keep (eduyrs) dec(3) stats(coef ci) ctitle(Risk ratio) eform replace

*************************************************************************************
* RESULTS FOR MALE SUBSAMPLE
*************************************************************************************

**# Bookmark

use "D:\BRST CNR\raw data\DHS\lesotho\2014\LSMR71DT\LSMR71FL.DTA", clear
gen age = mv012
gen birthmo = mv009
gen birthyr = mv010
gen eduyrs = mv133
gen birthmo_jul = birthmo >= 7 & birthmo <= 12 // our "instrumental variable"
gen everheardbreast = 1 if sm812j == 1
replace everheardbreast = 0 if sm812j == 0
gen affected = 1 if sm812k == 3
replace affected = 0 if sm812k == 1 | sm812k == 2
replace affected = 0 if sm812j == 0
keep if age >= 25
ivregress 2sls everheardbreast i.birthyr (eduyrs = birthmo_jul), r
est sto m1
estat firststage
margins if birthmo_jul == 0
ivregress 2sls affected i.birthyr (eduyrs = birthmo_jul), r
est sto m2
estat firststage
margins if birthmo_jul == 0
outreg2 [m1 m2] using results.xlsx, keep (eduyrs) dec(3) replace

*************************************************************************************
* CONTROLLING FOR YEARS OF SCHOOLING
*************************************************************************************

use LSdhs2009_14.dta, clear
reg everheardbreast birthmo_jul i.birthyr i.year eduyrs, r
est sto m1
reg breastselfexam birthmo_jul i.birthyr i.year eduyrs, r
est sto m2
reg breastclinical birthmo_jul i.birthyr i.year eduyrs, r
est sto m3
reg everheardpap birthmo_jul i.birthyr i.year eduyrs, r
est sto m4
reg everpapsmear birthmo_jul i.birthyr i.year eduyrs, r
est sto m5
outreg2 [m1 m2 m3 m4 m5] using results.xlsx, keep (birthmo_jul) dec(3) replace

*************************************************************************************
* CAUSAL PATHWAYS
*************************************************************************************

**# Bookmark

* Intention-to-treat results

use LSdhs2009_14.dta, clear
drop if lit == . | readnews == . | insured == . | wi == . | access == .
reg lit birthmo_jul i.birthyr i.year, r
est sto m1
margins if birthmo_jul == 0
reg readnews birthmo_jul i.birthyr i.year, r
est sto m2
margins if birthmo_jul == 0
reg wi birthmo_jul i.birthyr i.year, r
est sto m3
margins if birthmo_jul == 0
reg insured birthmo_jul i.birthyr i.year, r
est sto m4
margins if birthmo_jul == 0
reg access birthmo_jul i.birthyr i.year, r
est sto m5
margins if birthmo_jul == 0
outreg2 [m1 m2 m3 m4 m5] using results.xlsx, keep (birthmo_jul) dec(3) replace

* Instrumental variable regressions

use LSdhs2009_14.dta, clear
drop if lit == . | readnews == . | insured == . | wi == . | access == .
ivregress 2sls lit i.birthyr i.year (eduyrs = birthmo_jul), r
est sto m1
estat firststage
margins if birthmo_jul == 0
ivregress 2sls readnews i.birthyr i.year (eduyrs = birthmo_jul), r
est sto m2
estat firststage
margins if birthmo_jul == 0
ivregress 2sls wi i.birthyr i.year (eduyrs = birthmo_jul), r
est sto m3
estat firststage
margins if birthmo_jul == 0
ivregress 2sls insured i.birthyr i.year (eduyrs = birthmo_jul), r
est sto m4
estat firststage
margins if birthmo_jul == 0
ivregress 2sls access i.birthyr i.year (eduyrs = birthmo_jul), r
est sto m5
estat firststage
margins if birthmo_jul == 0
outreg2 [m1 m2 m3 m4 m5] using results.xlsx, keep (eduyrs) dec(3) replace

*************************************************************************************
* CLEAN FOLDER
*************************************************************************************

erase "LSdhs2009_14.dta"
erase "LSdhs2009_14_full.dta"
erase "LSdhswomen2009.dta"
erase "LSdhswomen2014.dta"
erase "graph 1.dta"
erase "graph 2.dta"
erase "graph 3.dta"
erase "graph 4.dta"
erase "results.txt"
erase "results.xlsx"
erase "temp.dta"